package model;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class GlobalKeyListener implements KeyListener {

	@Override
	public void keyPressed(KeyEvent e) {

		switch (e.getKeyChar()) {
		case 'x':
			FindPath.mainWindow.getRadioObstacle().setSelected(true);
			break;
		case 'c':
			FindPath.mainWindow.getRadioClear().setSelected(true);
			break;
		case 's':
			FindPath.mainWindow.getRadioStart().setSelected(true);
			break;
		case 't':
			FindPath.mainWindow.getRadioEnd().setSelected(true);
			break;
		default:
			break;
		}
		/*
		 * if(e.getKeyCode() == KeyEvent.VK_X){
		 * FindPath.mainWindow.getRadioObstacle().setSelected(true); }else
		 * if(e.getKeyCode() == KeyEvent.VK_C){
		 * FindPath.mainWindow.getRadioClear().setSelected(true); }
		 */

	}

	@Override
	public void keyReleased(KeyEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void keyTyped(KeyEvent e) {
		// TODO Auto-generated method stub

	}

}
